source(here::here("code/load.R"))

trash <- new.env()
here("data/meta_analyses_raw/MunRam2021/vaa_df_prep.RData") |> 
  load(envir = trash)

trash$vaa_df |>
    mutate(meta_id = "MunRam2021",
           subfield = "CP",
           question = "What are the effects of Voting Advice Applications on turnout, vote choice, and issue knowledge?",
           year = as.numeric(gsub("[a-b]$", "", year)),
           overall_effect = "no",
           estimate = if_else(depvar_coarse == "issue knowledge",
                              pcor,
                              log_odds),
           std.error = if_else(depvar_coarse == "issue knowledge",
                            pcor_se,
                            log_odds_se)) |>
    select(meta_id,
           subfield,
           question,
           dv = depvar_coarse,
           study_id = bibkey,
           study_year = year,
           study_journal = journal,
           sample_size,
           estimate,
           std.error,
           overall_effect) |>
    write_csv(here("data/meta_analyses_clean/MunRam2021.csv"))

rm("trash")

